body {
    // undo water css' body styles
    max-width: revert;
    margin: 0;
    padding: 0 40px;
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

details,
details[open],
summary {
    all: revert;
}

blockquote {
    display: flex;
    padding: 0 0 0 1em;
    opacity: 0.8;
}

/* Fixes iOS font sizing anomaly */
code {
    text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
}

code:not([data-lang]) {
    color: var(--highlight);
}

code.inline {
    white-space: nowrap;
}

td>code.inline {
    white-space: break-spaces;
}

pre>code {
    padding: 15px;
}

// Styles for our diffcode shortcode
[data-add] {
    position: relative;

    &::before {
        content: "+";
        position: absolute;
        right: calc(100% + 3px);
        color: #6ac86aa6;
        font-weight: bold;
        pointer-events: none;
        user-select: none;
    }

    &>span {
        background-color: #ddffddcf;
    }
}

h1+p {
    font-size: 1.1em;
}

h2,
h3,
h4,
h5,
h6 {
    position: relative;

    .anchor {
        color: var(--text);
        position: absolute;
        top: 0;
        right: 100%;
        padding-right: 10px;
        opacity: 0.2;
        transition: opacity .2s ease;
        font-size: 1.5ex;
        line-height: 2em;
    }

    &:hover .anchor {
        opacity: 1;
    }
}

// Space out subheadings on the page
h2,
h3,
h4,
h5,
h6 {
    margin-top: 3rem;
}

// Cut the space out from subsequent headings (i.e. h2 followed by h3)
:is(h1, h2, h3, h4, h5, h6)+ :is(h2, h3, h4, h5, h6) {
    margin-top: 0;
}